package com.github.cyf.controller;

import com.github.cyf.common.model.Rs;
import com.github.cyf.service.CommentService;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chenyifan
 * @create 2024-11-14 15:44
 */
@RestController
@RequestMapping("/sql")
@Api(tags = "2、sql漏洞测试")
@ApiSupport(order = 2)
public class SqlController {

    @Autowired
    private CommentService commentService;

    /**
     *  2 or 1 = 1
     */
    @ApiOperation("1、sql注入")
    @ApiOperationSupport(order = 1)
    @GetMapping("/sqlInject")
    public Rs show(String type) {
        return Rs.ok().setData(commentService.queryByType(type));
    }

}